package com.example.config;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @author ：songxusheng
 * @description：
 * @date ：Created in 2022/5/20 11:24
 * @version:
 */
public class PrintLog implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("在目标方法执行之前打印。。。。。");
        // 执行目标方法
        Object object = methodInvocation.proceed();
        System.out.println("在目标方法执行之后打印。。。。。");
        return object;
    }
}
